package com.config.client;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.core.env.Environment;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
class HelloController {


    @Autowired
    private Environment environment;


    @GetMapping("/hello")
    public String hello() {
        //直接读取配置服务器映射的git项目文件的属性
        return environment.getProperty("config.msg");
    }
}
